package com.dianda.service;

import com.dianda.dao.ClassmateDao;
import com.dianda.dao.MessagesDao;
import com.dianda.pojo.Classmate;
import com.dianda.pojo.Messages;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MessagesService {
    @Autowired
    MessagesDao dao;

    //查询所有学生信息
    public List<Messages> getMessagesList(){
        return dao.findAll();
    }

    public Messages findById(Integer id) {
        return dao.getById(id);
    }
    public Messages add(Messages messages){
        Messages messages1 = dao.save(messages);
        return messages1;
    }
}
